package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
//@Component衍生注解: @Service
// @Component("bookService")      如果不写 默认的是bookServiceImpl
@Service("bookService")
public class BookServiceImpl implements BookService {
//      这里相当于xml配置文件中的autowire="byType"   根据类型自动匹配  不用写set方法
        @Autowired
        private BookDao bookDao;

        public void save() {
            System.out.println("book service save ...");
            bookDao.save();
        }

}
